var Main = function() {
	mui.init({
		swipeBack: false //启用右滑关闭功能
	});
	this.init();
	this.even();
	this.loadData();
};
Main.prototype = {
	init: function() {},
	even: function() {
		$("#btn-addBank").on('tap', function() {
			var url = server_url + "/pay/bindCardPay.do";
			var param = {
				"isMobile": isMobile,
				"mobile": storage.telphone,
				"userid": storage.memberId,
				"accountid": storage.memberId,
				"memberId": storage.memberId
			}
			url = UrlHelper.customUrl(UrlHelper.urlEncode(param), url);
			url = encodeURIComponent(url);
			mui.openWindow({"url":"huifu.html?url=" + url + "&module=bank","id":"huifu-page"});
			/*window.open(url, '_system', 'location=yes');*/
		})
	},
	loadData: function() {
		var bankListUrl = server_url + "/financePurchase/getBindBankListFinancePurchase.do";
		var param = {
			"isMobile": isMobile,
			"memberId": storage.getItem("memberId")
		}
		$.getJSON(bankListUrl, param, function(retData) {
			if(!retData.success) {
				mui.alert(retData.message, '', '确定', function(e) {
					window.history.go(-1);
				});
			} else {
				var list = retData.data;
				if(list) {
					for(var i = 0, length = list.length; i < length; i++) {
						var html = '<div class="mui-card"><div class="mui-card-content">' +
							'<p>' + (!list[i].bankname ? "" : list[i].bankname) + '</p>' +
							'<p>' + '储蓄卡' + '</p>' +
							'<p>' + list[i].cardNum + '</p>' +
							'</div></div > ';
						$('.mui-content').append(html);
					}
				}
			}
		})

	}
}